//
//  NewListCell.m
//  cityStar
//
//  Created by wangjia on 15/3/31.
//  Copyright (c) 2015年 tiny. All rights reserved.
//

#import "NewListCell.h"
#import "UIImageView+WebCache.h"
#import "DateUtil.h"

@implementation NewListCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setValueWithObject:(NewsList *)newsList{
    self.lblTitle.text = newsList.name;
    self.lblContent.text = newsList.sub_name;
    self.lblTime.text = [DateUtil getTimeWithChuo:newsList.create_time];
    
    if (newsList.image == 0) {
        self.lcIvWidth.constant = 0;
        self.lcLeft1.constant = 0;
        self.lcLeft2.constant = 0;
    }else{
        self.lcIvWidth.constant = 90;
        self.lcLeft1.constant = 8;
        self.lcLeft2.constant = 8;
        NSString *strImageUrl = [@"" stringByAppendingFormat:@"http://api.icszx.com/image/c/id/%d/w/400/h/200/m/1",newsList.image];
        [self.ivContent sd_setImageWithURL:[NSURL URLWithString:strImageUrl] placeholderImage:nil options:SDWebImageLowPriority|SDWebImageRetryFailed];
    }
}

@end
